<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">


<head th:replace="backstage/common/head::head"></head>
<style>
    .treebox {
        width: 300px;
        position: absolute;
        left: 0;
        right: 0;
        top: 200px;
        bottom: 0;
        margin: auto;
    }

    .wrap {
        text-align: center;
    }

    .ztree {
        padding-left: 200px;
        padding-top: 50px;
    }

    .ztree li span.button {
        background-position-x: -144px;
        background-position-y: -1px;
    }

    #content-container:before {
        background: none;
    }

    .lay-win {
        display: none;
    }
    #demo-nifty-settings {
        display: none !important;
    }
</style>
<!--TIPS-->
<!--You may remove all ID or Class names which contain "demo-", they are only used for demonstration. -->

<body>
    <div id="container" class="effect aside-float aside-bright mainnav-lg">

        <!--NAVBAR-->
        <!--===================================================-->
        <header id="navbar" th:replace="backstage/common/header::header"></header>
        <!--===================================================-->
        <!--END NAVBAR-->

        <div class="boxed">
            <div id="content-container">
               <form th:action="@{/backstage/comm/selectAllList}">
                    <div class="layui-form-item" style="margin-top: 50px;">
                            <div class="layui-input-block" style="text-align: center;">
                                <select name="states" lay-verify="required" style="width:20%;">
                                    <option value="0">全部</option>
                                    <option value="1">屏蔽</option>
                                    <option value="2">正常</option>
                                </select>
                              <button type="submit" class="layui-btn" style="margin-left: 20px;">查询</button>
                            </div>
                    </div>
                </form>
                <!--CONTENT CONTAINER-->
                <!--===================================================-->
                <div id="page-content">
                    <table class="layui-table">
                        <tr>
                            <th style="width:50px;">
                                序号
                            </th>
                            <th>
                                评论人
                            </th>
                            <th>
                                评论文章
                            </th>
                            <th>
                                评论内容
                            </th>
                            <th>
                                时间
                            </th>
                            <th>
                                状态
                            </th>
                            <th>
                                操作
                            </th>
                        </tr>
                        <tr th:each="buy, buyStat: ${commentList.data}">
                            <td th:text="${buyStat.index+1}">1</td>
                            <td th:text="${buy.user_name}">admin</td>
                            <td th:if="${buy.obj_type}==0" th:text="${buy.article_name}">win10激活工具</td>
                            <td th:if="${buy.obj_type}==1" >关于我们</td>
                            <td th:if="${buy.obj_type}==2" >赞助我们</td>
                            <td th:text="${#strings.abbreviate(buy.content,20)}" th:title="${buy.content}">2019-02-18</td>
                            <td th:text="${buy.create_time}">￥20.00</td>
                            <td th:if="${buy.states}">屏蔽</td>
                            <td th:if="${!buy.states}">正常</td>
                            <td> <a class="layui-btn layui-btn-sm" th:href="@{/backstage/comm/pingbi(id=${buy.id})}">
                                <i class="layui-icon">&#x1006;</i>
                            </a></td>
                        </tr>
                    </table>
                    <div id="page" style="text-align: center;"></div>
                    <script th:inline="javascript">
                        layui.use(['laypage','laydate'], function(){
                            var laypage = layui.laypage;
                            //var laydate = layui.laydate;

                            //执行一个laydate实例
                           /* laydate.render({
                                elem: '#startTime' //指定元素
                            });
                            //执行一个laydate实例
                            laydate.render({
                                elem: '#endTime' //指定元素
                            });*/
                            //执行一个laypage实例
                            laypage.render({
                                elem: 'page' //注意，这里的 test1 是 ID，不用加 # 号
                                ,count: [[${commentList.totalCount}]] //数据总数，从服务端得到
                                ,curr:[[${commentList.pageIndex}]]
                                ,limit:10
                                ,jump: function(obj, first){
                                    //obj包含了当前分页的所有参数，比如：
                                    //console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
                                    //console.log(obj.limit); //得到每页显示的条数

                                    //首次不执行
                                    if(!first){
                                        //do something
                                        //var startTime=$("#startTime").val();
                                        //var endTime=$("#endTime").val();
                                        var page=parseInt(obj.curr);
                                        window.location.href="/backstage/comm/selectAllList?pageIndex="+page;
                                    }
                                }
                            });
                        });
                    </script>
                </div>
            </div>
            <!--===================================================-->
            <!--END CONTENT CONTAINER-->

            <!--MAIN NAVIGATION-->
            <!--===================================================-->
            <nav id="mainnav-container" th:replace="backstage/common/left::left(7)"></nav>
            <!--===================================================-->
            <!--END MAIN NAVIGATION-->

        </div>



        <!-- FOOTER -->
        <!--===================================================-->
        <footer id="footer" th:replace="backstage/common/foot::footer"></footer>
        <!--===================================================-->
        <!-- END FOOTER -->


        <!-- SCROLL PAGE BUTTON -->
        <!--===================================================-->
        <button class="scroll-top btn">
            <i class="pci-chevron chevron-up"></i>
        </button>
        <!--===================================================-->
    </div>
    <!--===================================================-->


    <!--=================================================-->

    <!--jQuery [ REQUIRED ]-->
    <script src="../../static/backstage/js/jquery.min.js"></script>


    <!--BootstrapJS [ RECOMMENDED ]-->
    <script src="../../static/backstage/js/bootstrap.min.js"></script>


    <!--NiftyJS [ RECOMMENDED ]-->
    <script src="../../static/backstage/js/nifty.min.js"></script>




    <!--=================================================-->

    <!--Demo script [ DEMONSTRATION ]-->
    <script src="../../static/backstage/js/demo/nifty-demo.min.js"></script>


    <!--Summernote [ OPTIONAL ]-->
    <script src="../../static/backstage/plugins/summernote/summernote.min.js"></script>

</body>

</html>